<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>增加学生</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="Login/css/zc.css"/>
    <script src="layui/layui.js"></script>
    <script src="Login/js/jquery-3.5.1.min.js"></script>
    <script>
        function myfunction() {

            $.ajax({
                type: "POST",
                url: "/username",
                data: "s=1",
                success: function (data) {
                    console.log(data);
                    document.getElementById("user").value = data;
                }
            });

        }
        myfunction();
    </script>
</head>

<body>
<div id="bigBox">
    <form class="layui-form" action="/xgmm">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input id="user"  name="user" required lay-verify="required" readonly="true"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="text" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
                <input value="Student"   name="type" required lay-verify="required" readonly="true"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

</body>
</html>